package com.jxk.test;

import com.google.common.collect.Lists;
import com.jxk.common.config.EnableSwagger;
import com.jxk.test.entity.Role;
import com.jxk.test.entity.User;
import com.jxk.test.event.MyEvent;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;

import java.util.Arrays;

/**
 * @ClassName : Demo  //类名
 * @Description :   //描述
 * @Author : jxk  //作者
 * @Date: 2020-09-18 14:09  //时间
 */
@EnableAsync
@SpringBootApplication
@EnableSwagger
//@EnableScheduling
public class Demo {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(Demo.class, args);
        MyEvent myEvent = new MyEvent("test",new User("jxk","1234", Arrays.asList(new Role("总经理"))));
        context.publishEvent(myEvent);
    }
}
